package com.mygame.common.kit.hutool;


import java.io.File;
import java.nio.charset.Charset;
import java.util.Map;

/**
 * @author 渔民小镇
 * @date 2023-01-19
 */
public class AdapterHuUtils {
    public static String readStr(String resource, Charset charset) {
        return HuResourceUtil.readStr(resource, charset);
    }

    public static File mkdir(String dirPath) {
        return HuFileUtil.mkdir(dirPath);
    }

    public static File file(String path) {
        return HuFileUtil.file(path);
    }

    public static File writeUtf8String(String content, String path) throws HuIoRuntimeException {
        return HuFileUtil.writeUtf8String(content, path);
    }

    public static boolean isDirectory(String path) {
        return HuFileUtil.isDirectory(path);
    }

    public static boolean exist(File file) {
        return (null != file) && file.exists();
    }

    public static String format(CharSequence template, Map<?, ?> map) {
        return HuStrUtil.format(template, map);
    }

    public static String format(CharSequence template, Object... params) {
        return HuStrUtil.format(template, params);
    }

}
